const gulp = require('gulp');
const ts = require('gulp-typescript');
const tsProject = ts.createProject('tsconfig.json');

gulp.task('compile', function () {
    return gulp.src('./src/**/*.ts')
        .pipe(tsProject())
        .pipe(gulp.dest('lib'));

});

gulp.task('copy', function () {
    return gulp.src('src/config/yml/*.yml', {
            nodir: false
        })
        .pipe(gulp.dest('lib/config/yml'));
});

gulp.task('watch', function () {
    gulp.watch('src/**/*.ts', gulp.series('compile'));
});

gulp.task('default', gulp.series('compile', 'copy', 'watch'))
gulp.task('build', gulp.series('compile', 'copy'))